package generics_and_collections.queue;

/**
 * Created by Sam on 08/02/14.
 */
public class QueueTest {

    public QueueTest() {

    }

    public void execute() {

        IQueue queue = new MyQueue(3);

        // rear = next empty slot

        queue.add("a"); // rear 1, front 0
        queue.add("b"); // rear 2, front 0
        queue.add("c"); // rear 0, front 0
        queue.remove(); // rear 0, front 1 remove 'a' from front of queue, rear stays, front changes
        queue.add("d"); // rear 1, front 1 add to rear of queue, next empty now 1 (just took 0)

        System.out.println(queue.toString());
        System.out.println("num elements " + queue.size());
    }
}
